<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ConcessionShare extends Model
{
    public $table = 'concession_share';

    public $timestamps = false;

    public $guarded = [];

    public $primaryKey = 'id_concession_share';

    public static function getShareRegisterGiftByMerchantId($id_merchant)
    {
        return self::where('id_merchant',$id_merchant)
            ->where('is_delete','N')
            ->where('type','register')
            ->first();
    }

    public static function getShareCardGiftByMerchantId($id_merchant)
    {
        return self::where('id_merchant',$id_merchant)
            ->where('is_delete','N')
            ->where('type','shareCard')
            ->first();
    }
}
